<template>
  <div id="app">
    <!-- 路由出口：显示组件的容器 -->
    <keep-alive include="find">    
    <router-view />
    </keep-alive> 
    <!-- 底部tab栏 -->
    <van-tabbar
      v-model="active"
      @change="onChange"
      route
      active-color="#8bc34a"
      placeholder   
    >
      <van-tabbar-item to="/" icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item to="/find" icon="search">搜索</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data () {
    return {
      active: 0
    }
  },
  methods: {
    //点击tabbar
    onChange () {
      console.log(this.active)
    }
  }
}
</script>

<style lang="less"></style>
